package top.chenfu1201.clientApi.mns;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import top.chenfu1201.clientApi.config.mns.RabbitFanoutConfig;

@Component
public class FanoutExchangeProvider {

    private static final Logger log = LoggerFactory.getLogger(FanoutExchangeProvider.class);

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendMsg(String msg) {
        log.info(msg);
        rabbitTemplate.convertAndSend(RabbitFanoutConfig.FANOUT_NAME, null, msg);
    }

}
